/* Copyright (C) Nial Peters 2014
 *
 * This file is part of pydoas.
 *
 * pydoas is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * pydoas is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with pydoas.  If not see <http://www.gnu.org/licenses/>.
 */
#ifndef __FITTING_H
#define __FITTING_H

#include "traceback.h"
#include "shift_and_squeeze.h"

//// Type Declarations ////
typedef struct fit_data_t {

	sns_data_t *sns_data;
	double * fit_matrix;

	int poly_order;

} fit_data_t;

//// Function Prototypes ////

fit_data_t *
createFitDataObj  (double **refs, int num_refs, double **ref_wavelengths,
		           int *ref_lengths, double *fitting_wavelengths,
		           int fit_window_length, int poly_order);

void
destroyFitDataObj (fit_data_t **data);

int
fitSpectrum       (fit_data_t *fit_obj, double *wavelengths, double *counts,
		           int spec_length);


#endif //__FITTING_H
